#

include         ../../../dist/dev/include/apmmodule/Makefile_comm.mk

CFLAGS          = 
CFLAGS          += $(CFLAGS_EXT)

#protoc代码路径
PROTOC_PATH   := ../../../../../common/protoc/src

LIBS            = -lprotobuf-c -lgthread-2.0 -luuid -lzmq -lzlog -ljson-c
LIBS            += $(LIBS_EXT)

INCLUDES = -I. -I$(LIB_I_APM_COMM) -I$(PROTOC_PATH)/client

TARGET_BIN        := client

all: clean compile $(TARGET_BIN)

$(TARGET_BIN):
	$(CC) -o $@ $(CFLAGS) frcmd_client.c frcmd_parse_detail.c frcmd_parse.c lex.yy.c $(PROTOC_PATH)/client/client.pb-c.c $(LIB_A_APM_COMM_C) $(INCLUDES) $(LIBS)

compile:
	flex cmd.l;bison cmd.y;

install:
	rm -f $(COMM_DIST_DIR_BIN)/$(TARGET_BIN); mkdir -p  $(COMM_DIST_DIR_BIN); cp $(TARGET_BIN) $(COMM_DIST_DIR_BIN)/.

uninstall:
	rm -f $(COMM_DIST_DIR_BIN)/$(TARGET_BIN)

clean:
	rm -f *.o $(TARGET_BIN) *~ 

# EOF
